com.facebook
Class Settings

java.lang.Object
  extended by com.facebook.Settings

public final class Settings
extends Object

Allows some customization of sdk behavior.


Constructor Summary
Settings()
           
 
Method Summary
static void addLoggingBehavior(LoggingBehavior behavior)
          Certain logging behaviors are available for debugging beyond those that should be enabled in production.
static void clearLoggingBehaviors()
          Certain logging behaviors are available for debugging beyond those that should be enabled in production.
static String getAttributionId(ContentResolver contentResolver)
           
static Executor getExecutor()
          Returns the Executor used by the SDK for non-AsyncTask background work.
static Set<LoggingBehavior> getLoggingBehaviors()
          Certain logging behaviors are available for debugging beyond those that should be enabled in production.
static boolean getShouldAutoPublishInstall()
          Gets whether opening a Session should automatically publish install attribution to the Facebook graph.
static boolean isLoggingBehaviorEnabled(LoggingBehavior behavior)
          Certain logging behaviors are available for debugging beyond those that should be enabled in production.
static boolean publishInstallAndWait(Context context, String applicationId)
          Manually publish install attribution to the Facebook graph.
static void publishInstallAsync(Context context, String applicationId)
           
static void removeLoggingBehavior(LoggingBehavior behavior)
          Certain logging behaviors are available for debugging beyond those that should be enabled in production.
static void setExecutor(Executor executor)
          Sets the Executor used by the SDK for non-AsyncTask background work.
static void setShouldAutoPublishInstall(boolean shouldAutoPublishInstall)
          Sets whether opening a Session should automatically publish install attribution to the Facebook graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Settings

public Settings()
Method Detail

getLoggingBehaviors

public static final Set<LoggingBehavior> getLoggingBehaviors()
Certain logging behaviors are available for debugging beyond those that should be enabled in production. Returns the types of extended logging that are currently enabled.

Returns:
a set containing enabled logging behaviors

addLoggingBehavior

public static final void addLoggingBehavior(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be enabled in production. Enables a particular extended logging in the sdk.

Parameters:
behavior - The LoggingBehavior to enable

removeLoggingBehavior

public static final void removeLoggingBehavior(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be enabled in production. Disables a particular extended logging behavior in the sdk.

Parameters:
behavior - The LoggingBehavior to disable

clearLoggingBehaviors

public static final void clearLoggingBehaviors()
Certain logging behaviors are available for debugging beyond those that should be enabled in production. Disables all extended logging behaviors.


isLoggingBehaviorEnabled

public static final boolean isLoggingBehaviorEnabled(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be enabled in production. Checks if a particular extended logging behavior is enabled.

Parameters:
behavior - The LoggingBehavior to check
Returns:
whether behavior is enabled

getExecutor

public static Executor getExecutor()
Returns the Executor used by the SDK for non-AsyncTask background work. By default this uses AsyncTask Executor via reflection if the API level is high enough. Otherwise this creates a new Executor with defaults similar to those used in AsyncTask.

Returns:
an Executor used by the SDK. This will never be null.

setExecutor

public static void setExecutor(Executor executor)
Sets the Executor used by the SDK for non-AsyncTask background work.

Parameters:
executor - the Executor to use; must not be null.

publishInstallAsync

public static void publishInstallAsync(Context context,
                                       String applicationId)

setShouldAutoPublishInstall

public static void setShouldAutoPublishInstall(boolean shouldAutoPublishInstall)
Sets whether opening a Session should automatically publish install attribution to the Facebook graph.

Parameters:
shouldAutoPublishInstall - true to automatically publish, false to not

getShouldAutoPublishInstall

public static boolean getShouldAutoPublishInstall()
Gets whether opening a Session should automatically publish install attribution to the Facebook graph.

Returns:
true to automatically publish, false to not

publishInstallAndWait

public static boolean publishInstallAndWait(Context context,
                                            String applicationId)
Manually publish install attribution to the Facebook graph. Internally handles tracking repeat calls to prevent multiple installs being published to the graph.

Parameters:
context - the current Context
Returns:
returns false on error. Applications should retry until true is returned. Safe to call again after true is returned.

getAttributionId

public static String getAttributionId(ContentResolver contentResolver)